package com.pickup.utils;

public class StringUtil {
    public String[] getUserId(String content) {
        String senderId = null;
        String receiverId = null;
        String[] replace = content
                .replace("\":{\"", " ")
                .replace("\":", " ")
                .replace("\",", " ")
                .replace(" \"", " ")
                .replace(",\"", " ").split(" ");
        for (int i = 0; i < replace.length; i++) {
            if (replace[i].equals("senderId")) {
                senderId = replace[i + 1].equals("null") ? null : replace[i + 1];
            }
            if (replace[i].equals("receiverId")) {
                receiverId = replace[i + 1].equals("null") ? null : replace[i + 1];
            }
        }
        return new String[]{senderId, receiverId};
    }



}
